package com.lz.football.module.activity.liveness
{
	import com.common.utils.Reflection;
	import com.lz.football.module.base.IComponent;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.text.TextField;

	/**
	 *  
	 * @author Administrator
	 * 
	 */	
	public class LivenessItem extends Sprite implements IComponent
	{
		/**
		 *皮肤 
		 */
		private var _skin:MovieClip;
		/**
		 *名称  
		 */
		private var actName:TextField;
		/**
		 *活跃度 
		 */
		private var live:TextField;
		/**
		 *任务完成状态 
		 */
		private var status:TextField;
		
		public function LivenessItem()
		{
			super();
		}
		
		public function initUI(view:Object=null):void
		{
			_skin = Reflection.createInstance("com.lz.res.livenessItem");
			this.addChild(_skin);
			actName = _skin.actName;
			live = _skin.live;
			status = _skin.status;
			actName.text = "名称";
			live.text = "活跃度：40";
			status.text = "未完成";
		}
		/**
		 *设置数据 
		 * 
		 */
		public function setDate($obj:Object):void
		{
			actName.text = $obj.name + ($obj.need > 1?$obj.per+ "/" + $obj.need : "");
			live.text = "活跃度：" + $obj.live;
			if($obj.per >= $obj.need)
			{
				status.textColor = 0x00FF00;
				status.text ="已完成"
			}else
			{
				status.text ="未完成";
				status.textColor = 0xFF0000;
			}
			
		}
		public function addEvtListener():void
		{
		}
		
		public function removeEvtListener():void
		{
		}
		
		public function destroyView():void
		{
		}
	}
}